﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GoodJinHuoList.aspx.cs" Inherits="Web.Admin.Good.GoodJinHuoList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="../../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../Scripts/WebInner.js" type="text/javascript"></script>
    <script src="../../Scripts/Common.js" type="text/javascript"></script>
    <link href="../../Styles/Common.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/Zebra/zebra_dialog.js" type="text/javascript"></script>
    <link href="../../Scripts/Zebra/zebra_dialog.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
      <script type="text/javascript">
          /*--------窗体启动设置和基本设置--------*/
          /*--loadFuntion--*/
          $(function () {

              InitWBID();
              $('#QWBID').change(function () {
                  if ($('#QWBID option:selected').val() != "") {
                      $('#txtWBID').val($('#QWBID option:selected').text());
                  }
              });
          });
          function InitWBID() {
              var WBName = $.trim($('#txtWBID').val());
              $('#QWBID').empty();
              $.ajax({
                  url: '/Ashx/wbinfo.ashx?type=GetWBByName&strName=' + WBName,
                  type: 'post',
                  data: '',
                  dataType: 'json',
                  success: function (r) {
                     
                      if (WBName == '') {
                          $('#QWBID').append("<option value=''>--请选择--</option>");
                      }
                      if (r.responseText == "Error") { return false; }
                      for (var i = 0; i < r.length; i++) {
                          $('#QWBID').append("<option value='" + r[i].ID + "'>" + r[i].strName + "</option>");
                      }

                  }, error: function (r) {

                  }
              });
          }

          function ShowUpdateQuanlity(ID,GoodID, WBID, Quanlity) {
           
              $('#divfrm').fadeIn('normal');
              $('#btnSave').removeAttr('disabled');
              $('#txt_ID').val(ID);
              $('#txt_GoodID').val(GoodID);
              $('#txt_WBID').val(WBID);
              $('#txt_QuanlityOriginal').val(Quanlity);
              $('input[name=Quanlity]').val(Quanlity);
          }

          //修改进货数量
          function FunUpdateQuanlity() {
              var ID = $('#txt_ID').val();
              var WBID = $('#txt_WBID').val();
              var GoodID = $('#txt_GoodID').val();
              var Quanlity = $('input[name=Quanlity]').val();
              var QuanlityOriginal = $('#txt_QuanlityOriginal').val();
              $.ajax({
                  url: '/Ashx/good.ashx?type=Update_GoodStockWB&ID=' + ID + '&WBID=' + WBID + '&GoodID=' + GoodID + '&Quanlity=' + Quanlity + '&QuanlityOriginal=' + QuanlityOriginal,
                  type: 'post',
                  data: '',
                  dataType: 'txt',
                  success: function (r) {
                      $('#btnSave').attr('disabled', 'disabled');
                      $.Zebra_Dialog('<strong>修改进货数量成功 ！</strong>');

                  }, error: function (r) {
                      $.Zebra_Dialog('<strong>修改进货数量失败 ！</strong>');
                  }
              });
          }


          function frmClose() {
              $('#divfrm').fadeOut();
          }

      </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="pageHead">
       <b>网点进货记录</b>
       <%-- <span id="spanHelp" style="cursor: pointer">帮助</span>--%>
    </div>
    <div id="divHelp"  class="pageHelp">
<span>提示1：各种查询可以独使用，也可以联合使用，但必须保证至少有一项查询条件。</span><br />
<span>提示2：每项查询均为模糊查询条件，为保证查找信息的正确性，请输入完整的查询信息。</span><br />

</div>
    

        <div id="Query">
            <span>网点名称:</span>
            <input type="text" id="txtWBID" onkeyup="InitWBID();" style="font-size:16px; width:100px; font-weight:bolder;" runat="server" />
            <select id="QWBID"  runat="server" style="width:100px;"></select> &nbsp;
            <span>起始日期:</span>
            <input type="text" id="Qdtstart" onclick="WdatePicker();" style="font-size:16px;width:100px; font-weight:bolder;" runat="server" />&nbsp;
           <span>结束日期:</span>
            <input type="text" id="Qdtend" onclick="WdatePicker()" style="font-size:16px;width:100px; font-weight:bolder;" runat="server" />&nbsp;
            


            <asp:ImageButton ID="ImageButton1" ImageUrl="~/images/seach_brown.png" 
                runat="server" onclick="ImageButton1_Click" />&nbsp;&nbsp;
                 <asp:Button ID="btnOutPut" runat="server"  class="outputExcel" Text="导出Excel" 
                 onclick="btnOutPut_Click" />
        </div>
        
        <div id="StorageList" style="margin:20px 0px">
        <asp:Repeater ID="Repeater1" runat="server">
            <HeaderTemplate>
                <table class="tabData" >
                    <tr class="tr_head">
                        <th style="width: 150px; height:20px; text-align: center;">
                            网点
                        </th>
                         <th style="width: 100px; text-align: center;">
                            商品
                        </th>
                      
                        <th style="width: 100px; text-align: center;">
                            商品规格
                        </th>
                        <th style="width: 100px; text-align: center;">
                            计量单位
                        </th>
                          <th style="width: 100px; text-align: center;">
                            商品价格
                        </th>
                         <th style="width: 100px; text-align: center;">
                            购买数量
                        </th>
                         <th style="width: 100px; text-align: center;">
                            购买时间
                        </th>
                         <th style="width: 100px; text-align: center;">
                            操作
                        </th>
                       
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr style='background-color: <%#(Container.ItemIndex%2==0)?"#FFFFF;":"#fcf3f4"%>'
                    onmouseover="change_colorOver(this)" onmouseout="change_colorOut(this)">
                   <td style="height:25px;">
                     
                        <%#Eval("WBName")%>
                    </td>
                    <td>
                        <%#Eval("GoodName")%>
                    </td>
                    <td>
                        <%#Eval("SpecID")%>
                    </td>
                    <td>
                        <%#Eval("UnitID")%>
                    </td>
                    <td>
                        ￥<%#(Eval("Price_Stock"))%>
                    </td>
                    <td>
                        <%#Eval("Quantity")%>
                    </td>
                    <td>
                        <%#Eval("dt_Trade")%>
                    </td>
                    <td>
                    <%#GetUpdateItem(Eval("ID"),Eval("GoodID"),Eval("WBID"),Eval("Quantity"))%>
                     
                    </td>
                   
                </tr>
            </ItemTemplate>
            <FooterTemplate>
           
                <!--底部模板-->
                </table>
                <!--表格结束部分-->
            </FooterTemplate>
        </asp:Repeater>
        
        </div>
         <div id="divfrm" class="pageEidt" style="display: none; top:50px;  width: 380px; height: 120px;">
    
        <div style="float: right; margin: 0px 20px 5px 0px">
            <input type="button" onclick="frmClose()" style="width: 60px; background-color: #ccc;" value="关闭"  />
         </div>
        <div style="clear: both;">
            <table>
                <tr>
                    <td align="right" style="width: 100px;">
                        <span>进货数量:</span>
                    </td>
                    <td>
                        <input type="text" name="Quanlity" style="width: 200px;" />
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 100px;">
                      
                    </td>
                    <td>
                        <input type="button" id="btnSave" value="确认" onclick="FunUpdateQuanlity();" style="width:80px;" />
                    </td>
                </tr>
              
            </table>
        </div>
    </div>
       
   
    
    <div  style="display:none;">
     <input type="text" id="txt_ID" />
     <input type="text" id="txt_GoodID" />
     <input type="text" id="txt_WBID" />
      <input type="text" id="txt_QuanlityOriginal" />
    </div>
    </form>
    
    <%--定义编号--%>
    <input type="hidden" id="WBID" value="" />
    <%--定义背景色的隐藏域--%>
    <input type="hidden" id="colorName" value="" />
</body>
</html>